package com.zzw.tddl;

import java.text.MessageFormat;

/**
 * 描述
 *
 * @author zhulixin
 */
public class AucsSequenceMain {

    public static void main(String[] args) throws Exception {
        System.setProperty("nacos.endpoint", "midenv.to7.mychebao.com");
        String app = "aucsm";
            String dataId = new MessageFormat("com.taobao.tddl.sequence.{0}").format(new Object[]{app});
//            String content = "<?xml version=\"1.0\" encoding=\"gb2312\"?>\n" +
//                    "<!DOCTYPE beans PUBLIC \"-//SPRING//DTD BEAN//EN\" \"http://www.springframework.org/dtd/spring-beans.dtd\">\n" +
//                    "<beans>\n" +
//                    "\t<bean id=\"auto_seq_user\" class=\"com.taobao.tddl.client.sequence.impl.GroupSequence\" init-method=\"init\">\n" +
//                    "\t\t<property name=\"sequenceDao\" ref=\"sequenceDao\" />\n" +
//                    "\t\t<property name=\"name\" value=\"auto_seq_user\" />\n" +
//                    "\t</bean>\n" +
//                    "\n" +
//                    "\t<bean id=\"sequenceDao\" class=\"com.taobao.tddl.client.sequence.impl.GroupSequenceDao\"\n" +
//                    "\t\tinit-method=\"init\">\n" +
//                    "\t\t<!--appName ,必填 -->\n" +
//                    "\t\t<property name=\"appName\" value=\"test_app\" />\n" +
//                    "\t\t<!--数据源的个数 -->\n" +
//                    "\t\t<property name=\"dscount\" value=\"1\" />\n" +
//                    "\t\t<!--dbGroupKeys必填 -->\n" +
//                    "\t\t<property name=\"dbGroupKeys\">\n" +
//                    "\t\t\t<list>\n" +
//                    "\t\t\t\t<value>test_app_group0</value>\n" +
//                    "\t\t\t</list>\n" +
//                    "\t\t</property>\n" +
//                    "\t\t<!--内步长 -->\n" +
//                    "\t\t<property name=\"innerStep\" value=\"100\" />\n" +
//                    "\t\t<!--是否开启自适应，默认是false -->\n" +
//                    "\t\t<property name=\"adjust\" value=\"true\" />\n" +
//                    "\t\t<property name=\"retryTimes\" value=\"100\" />\n" +
//                    "\n" +
//                    "\t\t<property name=\"gmtModifiedColumnName\" value=\"gmt_modified\" />\n" +
//                    "\t\t<property name=\"nameColumnName\" value=\"name\" />\n" +
//                    "\t\t<property name=\"tableName\" value=\"sequence\" />\n" +
//                    "\t\t<property name=\"valueColumnName\" value=\"value\" />\n" +
//                    "\t</bean>\n" +
//                    "</beans>\n";
        String content = "<?xml version=\"1.0\" encoding=\"gb2312\"?>\n" +
                "<!DOCTYPE beans PUBLIC \"-//SPRING//DTD BEAN//EN\" \"http://www.springframework.org/dtd/spring-beans.dtd\">\n" +
                "<beans>\n" +
                "\t<bean id=\"auto_seq_ams_bidprice_virtual\" class=\"com.taobao.tddl.client.sequence.impl.GroupSequence\" init-method=\"init\">\n" +
                "\t\t<property name=\"sequenceDao\" ref=\"sequenceDao\" />\n" +
                "\t\t<property name=\"name\" value=\"auto_seq_ams_bidprice_virtual\" />\n" +
                "\t</bean>\n" +
                "\n" +
                "\t<bean id=\"sequenceDao\" class=\"com.taobao.tddl.client.sequence.impl.GroupSequenceDao\"\n" +
                "\t\tinit-method=\"init\">\n" +
                "\t\t<property name=\"appName\" value=\"" + app + "\" />\n" +
                "\t\t<property name=\"dscount\" value=\"1\" />\n" +
                "\t\t<property name=\"dbGroupKeys\">\n" +
                "\t\t\t<list>\n" +
                "\t\t\t\t<value>" + app + "_main</value>\n" +
                "\t\t\t</list>\n" +
                "\t\t</property>\n" +
                "\t\t<property name=\"innerStep\" value=\"10000\" />\n" +
                "\t\t<property name=\"adjust\" value=\"true\" />\n" +
                "\t\t<property name=\"retryTimes\" value=\"100\" />\n" +
                "\n" +
                "\t\t<property name=\"gmtModifiedColumnName\" value=\"gmt_modified\" />\n" +
                "\t\t<property name=\"nameColumnName\" value=\"name\" />\n" +
                "\t\t<property name=\"tableName\" value=\"sequence\" />\n" +
                "\t\t<property name=\"valueColumnName\" value=\"value\" />\n" +
                "\t</bean>\n" +
                "</beans>\n";
           // ConfigService configService = NacosFactory.createConfigService();
//            boolean result = configService.publishConfig(dataId, null, content);*/
     //   System.out.println(result);
        System.out.println(dataId);
        System.out.println(content);
    }
}
